package com.ai.pos.client;

import java.util.ArrayList;

import com.ai.pos.client.module.Sales;
import com.ai.pos.client.module.interfaces.IModule;
import com.ai.pos.client.storage.CacheManager;
import com.ai.pos.client.user.User;
import com.allen_sauer.gwt.log.client.RemoteLogger;
import com.google.gwt.event.shared.EventBus;

public class AiCore {
	
	RemoteLogger clientLog;
	CacheManager cacheMgr;
	EventBus bus;
	
	User currentUser;
	
	
	ArrayList<IModule> modules;
	
	
	private AiCore()
	{
		//TODO: Bootstrap application?
		loadModules();
		//TODO: Does this happen before or after login? Either (semaphore)?
		
	}
	
	
	
	  private void loadModules() 
	  {
		  //TODO: This is where we check and load (IF statements??) only the modules the client has (all core modules).
		  modules = new ArrayList<IModule>();
		  modules.add(new Sales());
		  
		  //Load All modules
		  
		  
		  
		  
	  }



	public static AiCore getCore()
	    {
	      if (core == null)
	    	  core = new AiCore ();
	      
	      return core;
	    }
	
	
	
	private static AiCore core;

}
